﻿
namespace System.Linq.Functional
{
    public sealed class PatternMatchContext<T>
    {
        private readonly T value;

        internal PatternMatchContext(T value)
        {
            this.value = value;
        }

        public PatternMatch<T, TResult> With<TResult>(
            Predicate<T> condition,
            Func<T, TResult> result)
        {
            var match = new PatternMatch<T, TResult>(value);
            return match.With(condition, result);
        }

        public PatternMatch<T, TResult> With<TResult>(
            Predicate<T> condition,
            TResult result)
        {
            var match = new PatternMatch<T, TResult>(value);
            return match.With(condition, result);
        }
    }
}
